From 331629ede911f855b5e8dc335ca2f3a7a8bc3739 Mon Sep 17 00:00:00 2001 From: "cl349@arcadians.cl.cam.ac.uk" Date: Wed, 15 Dec 2004 18:16:37 +0000 Subject: [PATCH] bitkeeper revision 1.1159.1.481 (41c07f85G2hWDdcToBM9klxqtewYlQ) Bound number of vcpus by XEN_VCPUS environment variable in xend environment. --- tools/libxc/xc_linux_build.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/libxc/xc_linux_build.c b/tools/libxc/xc_linux_build.c index 052611852e..2540819d5f 100644 --- a/tools/libxc/xc_linux_build.c +++ b/tools/libxc/xc_linux_build.c @@ -127,6 +127,8 @@ static int setup_guestos(int xc_handle, unsigned long vpt_end; unsigned long v_end; + char *n_vcpus; + memset(&dsi, 0, sizeof(struct domain_setup_info)); rc = parseelfimage(image, image_size, &dsi); @@ -335,7 +337,11 @@ static int setup_guestos(int xc_handle, /* Mask all upcalls... */ for ( i = 0; i < MAX_VIRT_CPUS; i++ ) shared_info->vcpu_data[i].evtchn_upcall_mask = 1; - shared_info->n_vcpu = 32; + n_vcpus = getenv("XEN_VCPUS"); + if ( n_vcpus ) + shared_info->n_vcpu = atoi(n_vcpus); + else + shared_info->n_vcpu = 1; munmap(shared_info, PAGE_SIZE); /* Send the page update requests down to the hypervisor. */ -- 2.30.2